package com.kexin.coupon.entity;

import java.io.Serializable;
import java.time.LocalDateTime;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonIgnore;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="couponOrder对象", description="卡券订单表")
public class CouponOrder implements Serializable {

	private static final long serialVersionUID = 1L;

	@ApiModelProperty(value = "卡券订单id")
	@TableId(value = "id", type = IdType.AUTO)
	private Integer id;

	@ApiModelProperty(value = "订单号")
	@TableField
	private String orderNo;

	@ApiModelProperty(value = "用户id")
	@TableField
	private Integer userId;

	@JsonIgnore
	//@ApiModelProperty(value = "卡券渠道类型 (CP001 中石油)")
	@TableField
	private String channelType;

	@ApiModelProperty(value = "卡券id")
	@TableField
	private Integer couponId;

	@ApiModelProperty(value = "卡券编码")
	@TableField
	private String couponCode;

	@ApiModelProperty(value = "商品名称(卡券名称)")
	@TableField
	private String couponName;

	@ApiModelProperty(value = "卡券描述")
	@TableField
	private String detail;

	@ApiModelProperty(value = "卡券图片地址")
	@TableField
	private String pic;

	@ApiModelProperty(value = "卡券链接地址")
	@TableField
	private String linkUrl;

	@ApiModelProperty(value = "卡券面值，单位分")
	@TableField
	private String faceValue;

	@JsonIgnore
	//@ApiModelProperty(value = "是否同步获取申领结果 0同步  默认0")
	@TableField
	private String hasApplyNotify = "0";

	@ApiModelProperty(value = "是否允许退货，0允许 1不允许")
	@TableField
	private String hasRefund = "0";

	@JsonIgnore
	//@ApiModelProperty(value = "是否有核销通知，0通知 1不通知")
	@TableField
	private String hasUsedNotify;

	@ApiModelProperty(value = "品牌名称，连锁品牌时，卡券对应的品牌名称一致")
	@TableField
	private String brandName;

	@ApiModelProperty(value = "售价（分）")
	@TableField
	private Integer price = 0;

	@ApiModelProperty(value = "商品数量")
	@TableField
	private Integer num = 0;

	@ApiModelProperty(value = "订单总价 单位分")
	@TableField
	private Integer totalPrice = 0;

	@ApiModelProperty(value = "实际支付金额 单位分")
	@TableField
	private Integer amount = 0;

	@ApiModelProperty(value = "支付方式：1聚合支付")
	@TableField
	private Integer method = 1;

	@ApiModelProperty(value = "支付状态，0未支付，1已支付，2已过期，3已核销")
	@TableField
	private String payState = "0";

	@ApiModelProperty(value = "使用状态，0未使用，1已使用，2已过期")
	@TableField
	private String useState = "0";

	@ApiModelProperty(value = "退款状态，0未退款，1已退款，2退款失败，3退款处理中，4退款审核中，5拒绝退款")
	@TableField
	private String refundState = "0";

	@ApiModelProperty(value = "固定有效期开始时间，过期类型为1时必填，格式yyyy-MM-dd hh:mm:ss")
	@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
	@TableField
	private LocalDateTime startTime;

	@ApiModelProperty(value = "固定有效期过期时间，过期类型为1时必填，格式yyyy-MM-dd hh:mm:ss")
	@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
	@TableField
	private LocalDateTime expireTime;

	@JsonIgnore
	//@ApiModelProperty(value = "售卖渠道,1数字生活")
	@TableField
	private String buyChannel;

	@ApiModelProperty(value = "付款时间，格式yyyy-MM-dd hh:mm:ss")
	@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
	@TableField
	private LocalDateTime payTime;

	@ApiModelProperty(value = "使用时间，格式yyyy-MM-dd hh:mm:ss")
	@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
	@TableField(fill = FieldFill.INSERT)
	private LocalDateTime useTime;

	@ApiModelProperty(value = "退款时间，格式yyyy-MM-dd hh:mm:ss")
	@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
	@TableField(fill = FieldFill.UPDATE)
	private LocalDateTime refundTime;

	@ApiModelProperty(value = "创建时间，格式yyyy-MM-dd hh:mm:ss")
	@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
	@TableField(fill = FieldFill.INSERT)
	private LocalDateTime createTime;

	@ApiModelProperty(value = "更新时间，格式yyyy-MM-dd hh:mm:ss")
	@JsonFormat(pattern="yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
	@TableField(fill = FieldFill.UPDATE)
	private LocalDateTime updateTime;

	//@ApiModelProperty(value = "调起云闪付支付的tn号")
    @JsonIgnore
	@TableField
	private String tn;

	//@ApiModelProperty(value = "退款订单号")
    @JsonIgnore
	@TableField
	private String refundOrderNo;

	//@ApiModelProperty(value = "卡券申领订单号")
    @JsonIgnore
	@TableField
	private String busiCouponOrderNo;

	//@ApiModelProperty(value = "卡券申领退货订单号")
    @JsonIgnore
	@TableField
	private String busiCouponRefundOrderNo;

	//@ApiModelProperty(value = "卡券申领核销订单号")
    @JsonIgnore
	@TableField
	private String busiCouponUsedOrderNo;

	//@ApiModelProperty(value = "申领的卡券编号")
    @JsonIgnore
	@TableField
	private String couponNo;

}
